<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>星Z痕 - 星Z痕</title><meta name="author" content="星Z痕"><meta name="copyright" content="星Z痕"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="明德 修业 砺志 笃行">
<meta property="og:type" content="website">
<meta property="og:title" content="星Z痕">
<meta property="og:url" content="https://liy002.gitee.io/index.html">
<meta property="og:site_name" content="星Z痕">
<meta property="og:description" content="明德 修业 砺志 笃行">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://liy002.gitee.io/img/%E5%A4%B4%E5%83%8F.jpg">
<meta property="article:author" content="星Z痕">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://liy002.gitee.io/img/%E5%A4%B4%E5%83%8F.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://liy002.gitee.io/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"prismjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '星Z痕',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2022-09-25 23:04:45'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/touming/tm.css"><script src="https://fastly.jsdelivr.net/gh/Weidows-projects/live2d-moc3/dist/live2dcubismcore.min.js"></script><script src="https://fastly.jsdelivr.net/gh/Weidows-projects/live2d-moc3/dist/pixi.min.js"></script><script src="https://fastly.jsdelivr.net/gh/Weidows-projects/live2d-moc3/dist/live2d.min.js"></script><meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/atom.xml" title="星Z痕" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/%E5%A4%B4%E5%83%8F.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">20</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">12</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">1</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 列表</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-solid fa-shuttle-space"></i><span> 传送门</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://liy001.github.io/"><span> GitHub站</span></a></li><li><a class="site-page child" href="https://liy002.gitee.io"><span> Gitee站</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" target="_blank" rel="noopener" href="https://travellings.link"><i class="fa-fw fas fa-subway"></i><span> 开往</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://www.helloimg.com/images/2022/05/22/ZRh2kA.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">星Z痕</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 列表</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-solid fa-shuttle-space"></i><span> 传送门</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://liy001.github.io/"><span> GitHub站</span></a></li><li><a class="site-page child" href="https://liy002.gitee.io"><span> Gitee站</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" target="_blank" rel="noopener" href="https://travellings.link"><i class="fa-fw fas fa-subway"></i><span> 开往</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">星Z痕</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/LiY001" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:2477577791@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="https://www.helloimg.com/images/2022/05/09/RNS7Eg.png" target="_blank" title="QQ"><i class="fab fa-qq"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/2022/09/13/hei-ma-java/" title="JAVA"><img class="post_bg" src="https://www.helloimg.com/images/2022/09/25/Z80JM6.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JAVA"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/09/13/hei-ma-java/" title="JAVA">JAVA</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-09-13T03:24:45.000Z" title="发表于 2022-09-13 11:24:45">2022-09-13</time></span></div><div class="content">入门CMD1.切换磁盘
    磁盘名称+冒号
    E:--切换到E盘
2.查看当前路径下的内容
    dir
3.进入下一级目录(文件夹)
    cd 目录
4.回退到上一级目录
    cd..
5.进入多级目录
    cd 目录1\目录2\...
6.回退到磁盘根目录
    cd \
7.清屏
    cls
8.退出窗口
    exit
环境变量(系统)安装JDK
配置JAVA_HOME 路径：E:\VS\Java\jdk
配置Path      路径：%JAVA_HOME%\bin
JRE：Java的运行环境
IDEA快捷键格式化代码：Ctrl + Alt + L
向下复制一下：Ctrl + D
psvm + 回车：public static void main(String[] args) &#123; &#125;
sout + 回车：System.out.println();
背景：Settings - Appearance &amp; Behavior - Appearance → Background Image...
------
新建类
删除类：右 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/06/06/python/" title="Python"><img class="post_bg" src="https://www.helloimg.com/images/2022/09/25/Z80JM6.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Python"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/06/06/python/" title="Python">Python</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-06-06T04:30:45.000Z" title="发表于 2022-06-06 12:30:45">2022-06-06</time></span></div><div class="content">基础快捷键注释
# xxx
Ctrl + &#x2F;
输入输入函数
a = input(请输入)
输入的类型会变成字符串类型
a = int(input())
输出输出函数
print()

输出到文件中
ip=open('E:\study\py\测试.txt','a+')
# a+:文件不存在就创建文件，存在的话就在文件里输出
print('hello world',file=ip)
ip.close

print(a,b,c)  # , 以一个空格间隔输出 a b c

输出字符的数据类型
print(type(a))
转义字符\ + 首字母
\n 换行
\r 回车
例
  print("hello\nworld")
  结果
  hello
  world
保留字有特殊意义的单词

标识符由字母、数字、下划线_ 组成
不能以数字开头
不能是保留字
区分大小写

数据类型整数类型 int
  二进制   0b开头
  八进制   0o
  十六进制 0x

浮点数类型 float
  有时运算结果不准确
  from decimal import Decimal
  print( ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/04/13/bian-yi-yuan-li/" title="编译原理"><img class="post_bg" src="https://www.helloimg.com/images/2022/05/22/ZRhIlo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="编译原理"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/04/13/bian-yi-yuan-li/" title="编译原理">编译原理</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-04-13T11:52:04.000Z" title="发表于 2022-04-13 19:52:04">2022-04-13</time></span></div><div class="content">一编译的6个阶段词法分析 → 语法分析 → 语义分析 → 中间代码生成 → 代码优化 → 目标代码生成
前端的工作主要依赖于源语言，包括词法分析、语法分析、语义分析和中间代码生成
后端指的是那些依赖于目标机而一般不依赖于源语言，即目标代码生成
活前缀
</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/04/11/md-wen-dang-ge-shi/" title="md文档格式"><img class="post_bg" src="https://www.helloimg.com/images/2022/05/22/ZRhIlo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="md文档格式"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/04/11/md-wen-dang-ge-shi/" title="md文档格式">md文档格式</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-04-11T11:14:22.000Z" title="发表于 2022-04-11 19:14:22">2022-04-11</time></span></div><div class="content">一级标题# xxx
二级标题## xxx
三级标题### xxx
四级标题#### xxx
五级标题##### xxx
六级标题###### xxx

图片链接&lt;img src="">


链接本地图片![Alt text](./xxx)
链接网络图片![](xxx)</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/04/05/su-shu/" title="素数"><img class="post_bg" src="https://www.helloimg.com/images/2022/05/22/ZRhIlo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="素数"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/04/05/su-shu/" title="素数">素数</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-04-05T13:18:14.000Z" title="发表于 2022-04-05 21:18:14">2022-04-05</time></span></div><div class="content">筛选N以内的素数(ACM-1022)用简单素数筛选法求N以内的素数
素数：除了1和它本身，不能被任何整数整除的数。

import java.util.Scanner;

public class test1022 &#123;

	public static void main(String[] args) &#123;
		// TODO Auto-generated method stub
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		for (int i = 2; i &lt; n; i++) &#123;
			for (int j = 2; j &lt;= i; j++) &#123;
				if (i == j) &#123;
					System.out.println(i);
				&#125;
				if (i % j == 0) &#123;
					break;
				&#125;
			&#125;
		&#125;
	&#125;
&#125;
素数(ACM-1259 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/04/04/yang-hui-san-jiao-xing/" title="杨辉三角形"><img class="post_bg" src="https://www.helloimg.com/images/2022/09/25/Z80JM6.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="杨辉三角形"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/04/04/yang-hui-san-jiao-xing/" title="杨辉三角形">杨辉三角形</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-04-04T09:18:38.000Z" title="发表于 2022-04-04 17:18:38">2022-04-04</time></span></div><div class="content">蓝桥杯2021年第十二届省赛真题-杨辉三角形(ACM-2610)如果我们按从上到下、从左到右的顺序把所有数排成一列，可以得到如下数列：1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, …给定一个正整数 N，请你输出数列中第一次出现 N 是在第几个数？
输入
输入一个整数 N
6
输出
输出一个整数代表答案
13

import java.util.Scanner;

public class test2610 &#123;

	public static void main(String[] args) &#123;
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		long[][] arr = new long[1000][1000];
		int sum = 1;
		for (int i = 0; i &lt; arr.length; i++) &#123;
			for (int j = 0; j &lt;= i; j++) &#123;
				if (j == ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/04/02/hui-wen-shu/" title="回文数"><img class="post_bg" src="https://www.helloimg.com/images/2022/09/25/Z80JM6.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="回文数"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/04/02/hui-wen-shu/" title="回文数">回文数</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-04-02T07:16:22.000Z" title="发表于 2022-04-02 15:16:22">2022-04-02</time></span></div><div class="content">回文数 (Leetcode-9)给你一个整数 x ，如果 x 是一个回文整数，返回 true ；否则，返回 false 。
回文数是指正序（从左向右）和倒序（从右向左）读都是一样的整数。
例如，121 是回文，而 123 不是。
输入：x = 121
输出：true
-2^31 &lt;= x &lt;= 2^31 - 1

import java.util.Scanner;

public class lc9 &#123;

	public static void main(String[] args) &#123;
		Scanner s = new Scanner(System.in);
		int x = s.nextInt();
		System.out.println(name(x));
	&#125;

	public static boolean name(int x) &#123;
		if (x &lt; 0) &#123;
			return false;
		&#125;
		if (x == 0) &#123;
			return true;
		&#125; ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/03/29/lian-biao/" title="链表"><img class="post_bg" src="https://www.helloimg.com/images/2022/09/24/Z89nc6.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="链表"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/03/29/lian-biao/" title="链表">链表</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-03-29T14:24:48.000Z" title="发表于 2022-03-29 22:24:48">2022-03-29</time></span></div><div class="content">创建内部键入import java.util.LinkedList;

public class ceshi &#123;
	public static void main(String[] args) &#123;
		// TODO Auto-generated method stub
		LinkedList l1 = new LinkedList();// 双向链表
		l1.add(1);
		l1.add(2);
		l1.add(3);
		System.out.println(l1);// [1, 2, 3]
	&#125;
&#125;
键盘录入链表import java.util.LinkedList;
import java.util.Scanner;

public class ceshi &#123;

	public static void main(String[] args) &#123;
		// TODO Auto-generated method stub
		Scanner s = new Scanner(System.in);
		int n  ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/03/29/java-lan-qiao-bei/" title="JAVA-蓝桥杯"><img class="post_bg" src="https://www.helloimg.com/images/2022/09/25/Z80JM6.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JAVA-蓝桥杯"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/03/29/java-lan-qiao-bei/" title="JAVA-蓝桥杯">JAVA-蓝桥杯</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-03-29T11:19:13.000Z" title="发表于 2022-03-29 19:19:13">2022-03-29</time></span></div><div class="content">Eclipse创建Java项目[File] → [New] → [Java Project] → 输入名称 → [Finish]
[src]右击 → [New] → [Package] → [Finish]
右击新建的包 → [New] → [Class] → 输入文件名 → 勾选”public static void main(String[] args)” → [Finish] → 完成
修改类名右击 → [Refactor] → [Rename] → 输入新名 → [Finish]

注释//单行注释
/*
多行注释
*/

快捷键格式化：Ctrl+Shift+F
注释：Ctrl+Shift+C
快速修复：Ctrl+1
删除当前行：Ctrl+D
复制当前行到下一行：Ctrl+Alt+↓
当前行和下一行交换：Alt+↓
全局放大：Ctrl=+
全局缩小：Ctrl-—

Javapackage test;

//public表示公开的
//class表示定义一个类
//hello表示一个类名
public class hello &#123;// 表示定义一个公开的类，名为hello ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/03/27/li-kou-lian-xi/" title="LeetCode练习"><img class="post_bg" src="https://www.helloimg.com/images/2022/05/22/ZRhIlo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="LeetCode练习"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/03/27/li-kou-lian-xi/" title="LeetCode练习">LeetCode练习</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-03-27T03:14:35.000Z" title="发表于 2022-03-27 11:14:35">2022-03-27</time></span></div><div class="content">13. 罗马数字转整数罗马数字包含以下七种字符: I， V， X， L，C，D 和 M
字符         数值
I            1
V            5
X            10
L            50
C            100
D            500
M            1000
输入: s = &quot;III&quot;
输出: 3

import java.util.HashMap;
import java.util.Map;

public class dome13 &#123;

	public static void main(String[] args) &#123;
		// TODO Auto-generated method stub
		System.out.println(romanToInt("VI"));// 输出结果
	&#125;

	public static int romanToInt(String s) &#123;
		Map&lt;Character, Integer> map  ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/03/21/nong-tian-guan-gai/" title="农田灌溉"><img class="post_bg" src="https://www.helloimg.com/images/2022/09/25/Z80JM6.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="农田灌溉"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/03/21/nong-tian-guan-gai/" title="农田灌溉">农田灌溉</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-03-21T12:44:37.000Z" title="发表于 2022-03-21 20:44:37">2022-03-21</time></span></div><div class="content">农夫约翰有 n 片连续的农田，编号依次为 1∼n。
其中有 k 片农田中装有洒水器。
装有洒水器的农田的编号从小到大依次为 x1,x2,…,xk。
在某个炎热的中午，约翰觉得是时候给他的所有农田浇水了。
每个洒水器在打开以后，向两侧方向洒水，并且随着开启时间延长，有效覆盖距离也不断增长。

具体来说，我们将第 xi 片农田中的洒水器打开，经过 1 秒后，第 xi 片农田被其覆盖，经过 2 秒后，第 [xi−1,xi+1] 片农田被其覆盖，经过 j 秒后，第 [xi−(j−1),xi+(j−1)] 片农田被其覆盖。
注意，每个洒水器的有效覆盖距离在每经过整数秒后，才会有所增长。

例如，经过 2.5 秒后，被第 xi 片农田中的洒水器覆盖的农田仍是第 [xi−1,xi+1] 片农田，而不是第 [xi−1.5,xi+1.5] 片农田。
现在，约翰将所有洒水器同时打开，请问经过多少秒后，所有农田均被灌溉。

输入格式
第一行包含整数 T，表示共有 T 组测试数据。
每组数据第一行包含两个整数 n,k。
第二行包含 k 个整数 x1,x2,…,xk。
3
5 1
3
3 3
1 2 3
4 1 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/03/18/jin-zhi-zhuan-huan/" title="进制转换"><img class="post_bg" src="https://www.helloimg.com/images/2022/05/22/ZRhIlo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="进制转换"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/03/18/jin-zhi-zhuan-huan/" title="进制转换">进制转换</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-03-18T03:00:27.000Z" title="发表于 2022-03-18 11:00:27">2022-03-18</time></span></div><div class="content">进制转换编程，输入一个１０进制正整数，然后输出它所对应的八进制数
暴力破解package lc;

import java.util.Scanner;

public class test1055 &#123;

	public static void main(String[] args) &#123;
		// TODO Auto-generated method stub
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		String str = "";// 定义一个空字符串
		while (n > 0) &#123;
			str = n % 8 + str;// 字符串相加
			n /= 8;
		&#125;
		System.out.println(str);
	&#125;
&#125;
方法   int n = 10;
// 十进制转十六进制
Integer.toHexString(n);
// 十进制转八进制
Integer.toOctalString(n);
// 十进制转二进制
In ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/%E5%A4%B4%E5%83%8F.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">星Z痕</div><div class="author-info__description">明德 修业 砺志 笃行</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">20</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">12</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">1</div></a></div><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/LiY001" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:2477577791@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="https://www.helloimg.com/images/2022/05/09/RNS7Eg.png" target="_blank" title="QQ"><i class="fab fa-qq"></i></a></div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/09/13/hei-ma-java/" title="JAVA"><img src="https://www.helloimg.com/images/2022/09/25/Z80JM6.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JAVA"/></a><div class="content"><a class="title" href="/2022/09/13/hei-ma-java/" title="JAVA">JAVA</a><time datetime="2022-09-13T03:24:45.000Z" title="发表于 2022-09-13 11:24:45">2022-09-13</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/06/06/python/" title="Python"><img src="https://www.helloimg.com/images/2022/09/25/Z80JM6.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Python"/></a><div class="content"><a class="title" href="/2022/06/06/python/" title="Python">Python</a><time datetime="2022-06-06T04:30:45.000Z" title="发表于 2022-06-06 12:30:45">2022-06-06</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/04/13/bian-yi-yuan-li/" title="编译原理"><img src="https://www.helloimg.com/images/2022/05/22/ZRhIlo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="编译原理"/></a><div class="content"><a class="title" href="/2022/04/13/bian-yi-yuan-li/" title="编译原理">编译原理</a><time datetime="2022-04-13T11:52:04.000Z" title="发表于 2022-04-13 19:52:04">2022-04-13</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/04/11/md-wen-dang-ge-shi/" title="md文档格式"><img src="https://www.helloimg.com/images/2022/05/22/ZRhIlo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="md文档格式"/></a><div class="content"><a class="title" href="/2022/04/11/md-wen-dang-ge-shi/" title="md文档格式">md文档格式</a><time datetime="2022-04-11T11:14:22.000Z" title="发表于 2022-04-11 19:14:22">2022-04-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/04/05/su-shu/" title="素数"><img src="https://www.helloimg.com/images/2022/05/22/ZRhIlo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="素数"/></a><div class="content"><a class="title" href="/2022/04/05/su-shu/" title="素数">素数</a><time datetime="2022-04-05T13:18:14.000Z" title="发表于 2022-04-05 21:18:14">2022-04-05</time></div></div></div></div><div class="card-widget" id="card-newest-comments"><div class="item-headline"><i class="fas fa-comment-dots"></i><span>最新评论</span></div><div class="aside-list"><span>正在加载中...</span></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E7%AC%94%E8%AE%B0/"><span class="card-category-list-name">笔记</span><span class="card-category-list-count">5</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/%E7%AC%94%E8%AE%B0/" style="font-size: 1.45em; color: rgb(149, 66, 147)">笔记</a><a href="/tags/html/" style="font-size: 1.15em; color: rgb(11, 79, 105)">html</a><a href="/tags/JAVA/" style="font-size: 1.15em; color: rgb(179, 144, 162)">JAVA</a><a href="/tags/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1/" style="font-size: 1.15em; color: rgb(38, 98, 167)">面向对象</a><a href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" style="font-size: 1.15em; color: rgb(24, 165, 101)">数据库</a><a href="/tags/md/" style="font-size: 1.15em; color: rgb(75, 150, 120)">md</a><a href="/tags/Python/" style="font-size: 1.15em; color: rgb(180, 168, 132)">Python</a><a href="/tags/%E5%9B%9E%E6%96%87/" style="font-size: 1.15em; color: rgb(31, 157, 40)">回文</a><a href="/tags/%E7%AE%97%E6%B3%95%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%88%86%E6%9E%90/" style="font-size: 1.15em; color: rgb(183, 24, 26)">算法设计与分析</a><a href="/tags/%E7%B4%A0%E6%95%B0/" style="font-size: 1.15em; color: rgb(29, 97, 156)">素数</a><a href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9B%BE%E5%BD%A2%E5%AD%A6/" style="font-size: 1.15em; color: rgb(185, 12, 166)">计算机图形学</a><a href="/tags/%E9%93%BE%E8%A1%A8/" style="font-size: 1.15em; color: rgb(104, 121, 48)">链表</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/09/"><span class="card-archive-list-date">九月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/06/"><span class="card-archive-list-date">六月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/04/"><span class="card-archive-list-date">四月 2022</span><span class="card-archive-list-count">5</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/03/"><span class="card-archive-list-date">三月 2022</span><span class="card-archive-list-count">6</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/01/"><span class="card-archive-list-date">一月 2022</span><span class="card-archive-list-count">7</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">20</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2022-01-06T07:29:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">29.2k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-09-25T15:04:45.294Z"></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://www.helloimg.com/images/2022/05/22/ZRh2kA.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2022 By 星Z痕</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function subtitleType () {
  if (true) { 
    window.typed = new Typed("#subtitle", {
      strings: ["今日事,今日毕"],
      startDelay: 300,
      typeSpeed: 150,
      loop: true,
      backSpeed: 50
    })
  } else {
    document.getElementById("subtitle").innerHTML = '今日事,今日毕'
  }
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}</script></div><script>window.addEventListener('load', () => {
  const changeContent = (content) => {
    if (content === '') return content

    content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[图片]') // replace image link
    content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[链接]') // replace url
    content = content.replace(/<pre><code>.*?<\/pre>/gi, '[代码]') // replace code
    content = content.replace(/<[^>]+>/g,"") // remove html tag

    if (content.length > 150) {
      content = content.substring(0,150) + '...'
    }
    return content
  }

  const getComment = () => {
    const runTwikoo = () => {
      twikoo.getRecentComments({
        envId: 'twikoo-9gb03gtz6289e2f8',
        region: '',
        pageSize: 6,
        includeReply: true
      }).then(function (res) {
        const twikooArray = res.map(e => {
          return {
            'content': changeContent(e.comment),
            'avatar': e.avatar,
            'nick': e.nick,
            'url': e.url + '#' + e.id,
            'date': new Date(e.created).toISOString()
          }
        })

        saveToLocal.set('twikoo-newest-comments', JSON.stringify(twikooArray), 10/(60*24))
        generateHtml(twikooArray)
      }).catch(function (err) {
        const $dom = document.querySelector('#card-newest-comments .aside-list')
        $dom.innerHTML= "无法获取评论，请确认相关配置是否正确"
      })
    }

    if (typeof twikoo === 'object') {
      runTwikoo()
    } else {
      getScript('https://cdn.jsdelivr.net/npm/twikoo@1/dist/twikoo.all.min.js').then(runTwikoo)
    }
  }

  const generateHtml = array => {
    let result = ''

    if (array.length) {
      for (let i = 0; i < array.length; i++) {
        result += '<div class=\'aside-list-item\'>'

        if (true) {
          const name = 'src'
          result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
        }
        
        result += `<div class='content'>
        <a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
        <div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
        </div></div>`
      }
    } else {
      result += '没有评论'
    }

    let $dom = document.querySelector('#card-newest-comments .aside-list')
    $dom.innerHTML= result
    window.lazyLoadInstance && window.lazyLoadInstance.update()
    window.pjax && window.pjax.refresh($dom)
  }

  const newestCommentInit = () => {
    if (document.querySelector('#card-newest-comments .aside-list')) {
      const data = saveToLocal.get('twikoo-newest-comments')
      if (data) {
        generateHtml(JSON.parse(data))
      } else {
        getComment()
      }
    }
  }

  newestCommentInit()
  document.addEventListener('pjax:complete', newestCommentInit)
})</script><script src="/js/live2d.js"></script><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>